home *** CD-ROM | disk | FTP | other *** search
/ Apple II Magazines (PO) / Nibble Volume 11, No. 03 (1990-03)(MindCraft Publishing)(Side A).zip / Nibble Volume 11, No. 03 (1990-03)(MindCraft Publishing)(Side A).po / BASICS.ASM.txt < prev    next >
Text File  |  1996-12-24  |  4KB  |  123 lines

  1. ****************************
  2. * BASICS.ASM Source Code   *
  3. * by Sandy Mossberg        *
  4. * COPYRIGHT(C) 1990        *
  5. * MINDCRAFT PUBL. CORP.    *
  6. * CONCORD, MA 01742        *
  7. ****************************
  8. * APW ASSEMBLER
  9. ScreenMode  gequ     $80             ;640x200 super hi-res mode
  10.  
  11. *****************************************************************
  12. *
  13. StartUp     start
  14. *
  15. * Startup tool sets:
  16. *
  17. *****************************************************************
  18.             using    GlobalData
  19.  
  20. ; Startup first 2 tool sets:
  21.  
  22.             _TLStartUp               ;----start Tool Locator
  23.  
  24.             pha                      ;space for result
  25.             _MMStartUp               ;----start Memory Manager
  26.             jsr      HandlErr
  27.             PullWord MasterID        ;save master ID
  28.  
  29. ; Startup other tool sets:
  30.  
  31.             PushLong #0              ;space for result
  32.             PushWord MasterID        ;master ID
  33.             PushWord #0              ;ptr is reference
  34.             PushLong #SSRecOrig      ;ptr to orig StartStop record
  35.             ldx      #$1801          ;----call StartUpTools
  36.             jsl      $E10000
  37.             jsr      HandlErr
  38.             PullLong SSRecFinal      ;ptr to final StartStop record
  39.  
  40.             _InitCursor              ;convert cursor: wait -> arrow
  41.             rts
  42. ;................................................................
  43. ;
  44. ; StartUp data:
  45. ;
  46. SSRecOrig   anop                     ;original StartStop record
  47.             dc       i2'0'           ;flag word must be zero
  48.             dc       i2'ScreenMode'  ;640x200 super hi-res
  49.             dc       i2'0'           ;set by StartUpTools
  50.             dc       i4'0'           ;set by StartUpTools
  51.             dc       i2'TTSize/4'    ;number of tool sets
  52. ToolArray   dc       i2'$03,$0300'   ;Miscellaneous Tools
  53.             dc       i2'$04,$0301'   ;QuickDraw II
  54.             dc       i2'$05,$0301'   ;Desk Manager
  55.             dc       i2'$06,$0300'   ;Event Manager
  56.             dc       i2'$07,$0200'   ;Scheduler
  57.             dc       i2'$09,$0201'   ;Apple Desktop Bus
  58.             dc       i2'$0A,$0202'   ;SANE
  59.             dc       i2'$0B,$0200'   ;Integer Math
  60.             dc       i2'$0C,$0201'   ;Text Tools
  61.             dc       i2'$0E,$0301'   ;Window Manager
  62.             dc       i2'$0F,$0301'   ;Menu Manager
  63.             dc       i2'$10,$0301'   ;Control Manager
  64.             dc       i2'$12,$0300'   ;QuickDraw Auxiliary
  65.             dc       i2'$13,$0300'   ;Print Manager
  66.             dc       i2'$14,$0301'   ;LineEdit
  67.             dc       i2'$15,$0301'   ;Dialog Manager
  68.             dc       i2'$16,$0300'   ;Scrap Manager
  69.             dc       i2'$17,$0300'   ;Standard File Operations
  70.             dc       i2'$1B,$0301'   ;Font Manager
  71.             dc       i2'$1C,$0301'   ;List Manager
  72.             dc       i2'$22,$0100'   ;TextEdit
  73. TTSize      equ      *-ToolArray     ;number of array bytes
  74.             end
  75.  
  76. *****************************************************************
  77. *
  78. ShutDown    start
  79. *
  80. * Shutdown tools sets:
  81. *
  82. *****************************************************************
  83.             using    GlobalData
  84.  
  85.             PushWord #0              ;ptr is reference
  86.             PushLong SSRecFinal      ;ptr to final StartStop record
  87.             ldx      #$1901          ;----call ShutDownTools
  88.             jsl      $E10000
  89.  
  90.             PushWord MasterID        ;master ID
  91.             _MMShutDown
  92.             _TLShutDown
  93.             rts
  94.             end
  95.  
  96. *****************************************************************
  97. *
  98. HandlErr    start
  99. *
  100. * Check for error and handle fatal error:
  101. *
  102. *****************************************************************
  103.  
  104.             bcs      FatalErr        ;error detected
  105.             rts                      ;no error on carry clear
  106.  
  107. FatalErr    pha                      ;error code in A reg
  108.             PushLong #0              ;use default failure message
  109.             _SysFailMgr              ;die a horrible death
  110.             end
  111.  
  112. *****************************************************************
  113. *
  114. GlobalData  data
  115. *
  116. * Global program data:
  117. *
  118. *****************************************************************
  119.  
  120. SSRecFinal  ds       4              ;ptr to final StartStop record
  121. MasterID    ds       2              ;master memory ID of application
  122.             end
  123.